package com.sujinyang.stateless_service.shiro;

import org.apache.shiro.authc.AuthenticationToken;

import java.util.Map;

public class StatelessToken implements AuthenticationToken {
    //用户名
    private String username;

    //客户端密文摘要
    private String clientDigest;


    //客户端参数
    private Map<String,?> params;


    public StatelessToken(String username, Map<String, ?> params, String clientDigest) {
        this.clientDigest = clientDigest;
        this.username = username;
        this.params = params;
    }

    @Override
    public Object getPrincipal() {
        return username;
    }

    @Override
    public Object getCredentials() {
        return clientDigest;
    }



    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }


    public String getClientDigest() {
        return clientDigest;
    }

    public void setClientDigest(String clientDigest) {
        this.clientDigest = clientDigest;
    }

    public Map<String, ?> getParams() {
        return params;
    }

    public void setParams(Map<String, ?> params) {
        this.params = params;
    }
}
